<template>
<div>
    <h2 style="text-align: center;">用户投资明细</h2>
    <table class="table table-bordered">
            <thead>
                <tr style="background-color: aqua;">
                    <td>投资人登录账号</td>
                    <td>投资金额</td>
                    <td>投资时间</td>
                </tr>
            </thead>
    
            <tbody>
                <tr v-for="item in Info">
                    <td>{{ item.UL_Name }}</td>
                    <td>{{ item.UI_Money }}</td>
                    <td>{{ item.UI_Date.substring(0,10) }}</td>
                </tr>
            </tbody>
        </table>
</div>
</template>

<script setup lang="ts">
import { useRoute } from 'vue-router';
import axios from 'axios';
import {ref,onMounted} from 'vue';

//创建路由数据对象实例
const route=useRoute();

//创建响应式数据
const Info=ref([{
    UL_Name:"",
    UI_Money:0,
    UI_Date:""
}])

//创建生命周期函数钩子
onMounted(()=>{
    LoadData()
})

const LoadData=()=>{
    axios.get("https://localhost:44321/api/Invest/ShowUserInvest",
        {
            params:{
                Iid:route.params.Iid
            }
        }
    )
    .then(res=>{
        Info.value=res.data
    })
}
</script>